{% extends "admin/base.html" %}

{% block extrahead %}
<!-- TinyMCE -->
<script type="text/javascript" src="{{ MEDIA_URL }}/js/tinymce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    plugins : '-example', // - tells TinyMCE to skip the loading of the plugin
    mode : "textareas",
    theme : "advanced",
    theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom"
});
</script>
<!-- /TinyMCE -->
{% endblock %}

{% block content %}

<div class="wrap"> 
    <div id="icon-edit-pages" class="icon32"><br /></div> 
    <h2>{% trans "Add/Change" %} / {% trans "Flat Pages" %}<a href="/{{ SITE_URL }}fp/admin/" class="button add-new-h2">{% trans "Add New" %}</a> </h2> 
    
    <form id="flatPageAddChangeForm" name="flatPageAddChangeForm" action="" method="post">
        {% if flat_page %}<input type="hidden" name="id" value="{{ flat_page.id }}" /> {% endif %}
    
    <div id="poststuff" class="metabox-holder has-right-sidebar">    
        <div id="side-info-column" class="inner-sidebar"> 
            <div id="side-sortables" class="meta-box-sortables">
  
				<div id="submitdiv" class="postbox " > 
				    <div class="handlediv" title="Click to toggle"><br /></div>
				    <h3 class='hndle'><span>{% trans "Publish" %}</span></h3> 
				    <div class="inside"> 
				        <div class="submitbox" id="submitpost">              
							<div id="misc-publishing-actions"> 
							    <div class="misc-pub-section">
							        <label for="post_status">Status:</label>
							        <span id="post-status-display">Draft</span> 
							        <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'>Edit</a> 
							 
							        <div id="post-status-select" class="hide-if-js"> 
							            <select name='post_status' id='post_status' tabindex='4'> 
											<option value='pending'>Pending Review</option> 
											<option selected='selected' value='draft'>Draft</option> 
										</select> 
										<a href="#post_status" class="save-post-status hide-if-no-js button">OK</a> 
										<a href="#post_status" class="cancel-post-status hide-if-no-js">Cancel</a> 
							        </div> 
							 
							    </div> 
							    <div class="misc-pub-section " id="visibility"> 
							        Visibility: <span id="post-visibility-display">Public</span> 
							        <a href="#visibility" class="edit-visibility hide-if-no-js">Edit</a> 
							 
							        <div id="post-visibility-select" class="hide-if-js"> 
							            <input type="radio" name="visibility" id="visibility-radio-public" value="public"  checked='checked' /> <label for="visibility-radio-public" class="selectit">Public</label><br /> 
							            <input type="radio" name="visibility" id="visibility-radio-password" value="password"  /> <label for="visibility-radio-password" class="selectit">Password protected</label><br /> 
							            <span id="password-span"><label for="post_password">Password:</label> <input type="text" name="post_password" id="post_password" value="" /><br /></span> 
							            <input type="radio" name="visibility" id="visibility-radio-private" value="private"  /> <label for="visibility-radio-private" class="selectit">Private</label><br /> 
							            <p> 
											<a href="#visibility" class="save-post-visibility hide-if-no-js button">OK</a> 
											<a href="#visibility" class="cancel-post-visibility hide-if-no-js">Cancel</a> 
							            </p> 
							        </div> 
							    </div> 
							</div> 
							<div class="clear"></div> 
				
				            <div id="major-publishing-actions"> 
				                <div id="delete-action"> 
				                    <a class="submitdelete deletion" href="http://localhost/php/wordpress/wp-admin/post.php?post=20&amp;action=trash&amp;_wpnonce=b15c578945">Move to Trash</a>
				                </div>
				                
				                <div id="publishing-action"> 
									<img src="{{ ADMIN_MEDIA_URL }}/img/wpspin_light.gif" id="ajax-loading" style="visibility:hidden;" alt="" /> 
									<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="Publish" /> 
				                </div> 
				                <div class="clear"></div> 
				            </div> 
				        </div> 
				 
				    </div> 
				</div>                
                
                <div id="pageparentdiv" class="postbox " > 
                    <div class="handlediv" title="Click to toggle"><br /></div>
                    <h3 class='hndle'><span>Page Attributes</span></h3> 
                    <div class="inside"> 
                        <p>
                            <strong>Enable Comments</strong>&nbsp;&nbsp;&nbsp;
                            <input type="checkbox" id="enable_comments" name="enable_comments" value="1" {% if flat_page.o_enable_comments %} checked="checked"{% endif %}/>
                        </p>
                        <p>
                            <strong>Registration Required</strong>&nbsp;&nbsp;&nbsp;
                            <input type="checkbox" id="registration_required" name="registration_required" value="1" {% if flat_page.o_registration_required %} checked="checked"{% endif %}/>
                        </p>
                        
                        
                        <p><strong>Template Name</strong></p> 
                        <input type="text" id="template_name" name="template_name" value=""/>
                    </div>
                </div>                 
                
                
                
            </div>        
        </div> 
        
        <div id="post-body"> 
            <div id="post-body-content"> 
                <div id="titlediv"> 
                    <div id="titlewrap"> 
                        <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title">Enter title here</label> 
                        <input type="text" name="title" size="30" tabindex="1" value="{{ flat_page|trans 'title' }}" id="title" autocomplete="off" /> 
                    </div> 
                    <div class="inside"> 
                        <div id="edit-slug-box"></div>
                    </div> 
                </div> 
 
                <div id="postdivrich" class="postarea"> 
        
                    <div id='editorcontainer'><textarea rows='10' class='htheEditor' cols='40' name='content' tabindex='2' id='content'>{{ flat_page|trans 'content' }}</textarea></div>
                    
                    <table id="post-status-info" cellspacing="0"><tbody><tr> 
					    <td id="wp-word-count"></td> 
					    <td class="autosave-info"> 
					    <span id="autosave">&nbsp;</span> 
					    </td> 
					</tr></tbody></table>  
    
                </div>
            </div> 
        </div>	
    </form>
 
</div> 

<script type="text/javascript">
<!--
jQuery(document).ready( function($) {
	if ( $('#title').val() == '' ){
        $('#title').siblings('#title-prompt-text').css('visibility', '');
    }

    $('#title-prompt-text').click(function(){
        $(this).css('visibility', 'hidden').siblings('#title').focus();
    });
    
    $('#title').blur(function(){
        if (this.value == '')
            $(this).siblings('#title-prompt-text').css('visibility', '');
    }).focus(function(){
        $(this).siblings('#title-prompt-text').css('visibility', 'hidden');
    }).keydown(function(e){
        $(this).siblings('#title-prompt-text').css('visibility', 'hidden');
        $(this).unbind(e);
    });
});
//-->
</script>
        
{% endblock %}   